<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<script src="../vue.js"></script>

<body>
  <div id="app">
    <button @click="chickButton"> 查看子组件 </button>
    <my-component>
    </my-component>
  </div>


  <script>
    // 注册子组件
    Vue.component("my-component", {
      template: "<div>我是子组件</div>"
    })

    var vm = new Vue({
      el: "#app",
      methods: {
        chickButton() {
          console.log(this.$children);
        }
      }
    })
  </script>
</body>

</html>